package com.ruicar.afs.cloud.afscase.channel.feign;


import com.ruicar.afs.cloud.afscase.channel.entity.ChannelQuotaInfo;
import com.ruicar.afs.cloud.afscase.channel.entity.ChannelRiskInfo;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;
import java.util.Map;

/**
 * @description: 请求渠道服务
 * @author: mingzhi
 * @date: 2020/6/12 9:10
 */
@FeignClient(name = "channel", url = "${com.greatwall.services.channel-service.url}")
public interface ChannelFeignService {

    /**
     * 同步临时额度数据到渠道服务
     *
     * @param quotaInfoList
     * @param headers
     * @return
     */
    @PostMapping(value = "/channelInterFace/limitTakeUpOrLease")
    @ApiOperation("同步临时额度数据到渠道服务")
    public IResponse synchronousLimitToChannel(@RequestBody List<ChannelQuotaInfo> quotaInfoList, @RequestHeader Map<String, String> headers);

    /**
     * 优质等级有效期到期更新优质等级为：无
     *
     * @param channelRiskInfoList
     * @param headers
     * @return
     */
    @PostMapping(value = "/channelInterFace/qualityLevelUpdate")
    @ApiOperation("优质等级有效期到期更新优质等级")
    public IResponse synchronousQualityLevelToChannel(@RequestBody List<ChannelRiskInfo> channelRiskInfoList, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/channelQuota/updateChannelQuota")
    @ApiOperation("额度重算后推送到渠道端")
    IResponse updateChannelQuota(List<ChannelQuotaInfo> quotaInfo, @RequestHeader Map<String, String> headers);

    @PostMapping(value = "/common/getChannelSeal")
    @ApiOperation("通过渠道id 获取渠道的印章")
    IResponse getChannelSeal(String channelId, @RequestHeader Map<String, String> headers);

}
